package web

import (
	"google.golang.org/genproto/googleapis/rpc/status"
	"net/http"
)

type ApiReturn struct {
	*status.Status
	Payload interface{} `json:"payload,omitempty"`
}

//see http.checkWriteHeaderCode in net/http/server.go
func isValidStatusCode(code int) bool {
	return code >= 100 && code <= 999
}
func validStatusCode(code int) int {
	if isValidStatusCode(code) {
		return code
	}
	return http.StatusInternalServerError
}
